/*
 * @Author: HuangYue
 * @Date: 2022-05-09 01:57:14
 * @LastEditors: HuangYue
 * @LastEditTime: 2022-05-12 13:10:28
 * @FilePath: /graduation/src/components/DeviceDetail/DeviceVisualization/components/Line/index.jsx
 * @Description:
 */
import React, { useState, useEffect } from 'react';
import { Line } from '@ant-design/plots';

const DemoLine = ({ data }) => {
  const config = {
    data,
    xField: 'time',
    yField: 'count',
    seriesField: 'type',
    yAxis: {
      // label: {
      //   formatter: (v) => `${(v / 10000).toFixed(1)}`,
      // },
    },
    legend: {
      position: 'top',
    },
    smooth: true,
    // @TODO 后续会换一种动画方式
    animation: {
      appear: {
        animation: 'path-in',
        duration: 5000,
      },
    },
  };

  return <Line {...config} />;
};

export default DemoLine;
